﻿namespace SourceCodeRepository.Web.ViewDataTransformers
{
    using System.Collections.Generic;
    using Model.Entitites;
    using Views.ViewData;

    /// <summary>
    /// Contributor View Data Transformer.
    /// Transforms a Contributor entity to a Contributor View Data class to be used in the views.
    /// </summary>
    public class ContributorViewDataTransformer : ViewDataTransformer<ContributorViewData,Contributor>
    {
        protected override List<Transformer> Transforms
        {
            get
            {
                return new List<Transformer>
                           {
                               (x, y) => y.EmailAddress = x.EmailAddress,
                               (x, y) => y.Id = x.Id,
                               (x, y) => y.Name = x.Name,
                               (x, y) => y.UserName = x.UserName
                           };
            }
        }
    }
}
